/*
 * ModifyCost.h
 *
 *  Created on: 2013-2-3
 *      Author: Administrator
 */

#ifndef MODIFYCOST_H_
#define MODIFYCOST_H_
#include <qwidget.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qdialog.h>
#include <qlayout.h>
#include <qtextedit.h>
#include <qdebug.h>

class ModifyCost:public QDialog
{
	Q_OBJECT
public:
	enum{addMode = 0, modifyMode = 1};
	ModifyCost(QWidget *parent = 0);
	virtual ~ModifyCost();
	void setMode(const int &mode = addMode, const int &id = 0,
			const QString &name = 0, const QString &comment = 0, bool active = false);
signals:
	void sig_modifyOrAdd(const int &mode, const int &id,
			const QString &name, const QString &comment, const bool &active);
private slots:
	void slt_addOrModify();
private:
	QLabel typeLabel, commentLabel;
	QLineEdit nameLineEdit;
	QCheckBox checkBox;
	QTextEdit textEdit;
	QPushButton modifyButton, cancleButton;
	QGridLayout layout;
	int mode, id;

};

#endif /* MODIFYCOST_H_ */
